package bookshop.test;



import java.io.IOException;

import org.apache.ibatis.session.SqlSession;

import bookshop.DAO.BookDAOMapper;
import bookshop.DAO.WebOneSqlSession;
import bookshop.beans.Book;

public class DAOtest {
	public static void main(String[] args) {
		try {
			SqlSession session=WebOneSqlSession.getSqlSession();
			BookDAOMapper bookMapper=session.getMapper(BookDAOMapper.class);
			Book book=new Book("Ilya Grigorik","Web性能权威指南",54.50,"2011年04月01日",0,10,"怎么才能让Web应用速度快、效率高");
			bookMapper.addBook(book);
			session.commit();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}	
}
